﻿using OpenCvSharp;

using Xc.DataAccess.CodeReader.Properties;
using Xc.DataAccess.Core;

namespace Xc.DataAccess.CodeReader.Models.Filters
{
    [Filter("对数极坐标转换",FilterType.Algorithm)]
    public class AlgorithmLogPolar:FilterBase
    {
        [InputParameter("中心点")]
        public CVPointFloat Center { get; set; }=new CVPointFloat();
        [InputParameter("缩放")]
        public double M { get; set; }
        [InputParameter("变换标志")]
        public InterpolationFlags InterpolationFlags { get; set; }
        internal override ResultData<Mat> UseChannel(Mat mat, FilterBase[] filterInfos, FilterBase preFilterBase)
        {
            Mat mat1 = new Mat();
            Cv2.LogPolar(mat,mat1, Center,M, InterpolationFlags);
            return ResultData<Mat>.Accept(TextResource.resize_complete, mat1);
        }
    }
}
